﻿<!--<UserControl x:Class="ARDesigner.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:converter="clr-namespace:ARDesigner"
    mc:Ignorable="d" 
             d:DesignHeight="516" d:DesignWidth="674" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
             Loaded="UserControl_Loaded">-->

<UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="ARDesigner.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:converter="clr-namespace:ARDesigner"
    mc:Ignorable="d"
    d:DesignHeight="600" d:DesignWidth="800"
             Loaded="UserControl_Loaded">

    <UserControl.Resources>

        <converter:FpsConverter x:Key="Fps2TextConverter"/>

        <Style x:Key="GlassBorderStyle" TargetType="Border">
            <Setter Property="BorderThickness" Value="2"/>
            <Setter Property="Padding" Value="5"/>
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.75,1" StartPoint="0.25,0">
                        <GradientStop Color="#33FFFFFF" Offset="0"/>
                        <GradientStop Color="#C0FFFFFF" Offset="0.287"/>
                        <GradientStop Color="#4011322D" Offset="0.683"/>
                        <GradientStop Color="#33FFFFFF" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#5811322D" Offset="0"/>
                        <GradientStop Color="#3EFFFFFF" Offset="0.25"/>
                        <GradientStop Color="#FFFFFFFF" Offset="0.5"/>
                        <GradientStop Color="#3EFFFFFF" Offset="0.75"/>
                        <GradientStop Color="#BFFFFFFF" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Effect">
                <Setter.Value>
                    <DropShadowEffect BlurRadius="3" ShadowDepth="3" Opacity="0.5"/>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="StackPanelMargin" TargetType="StackPanel">
            <Setter Property="Margin" Value="5"/>
        </Style>

    </UserControl.Resources>

    <Grid x:Name="RootGrid" Background="Black" >
        <StackPanel>
        <Grid Name="ViewportContainer" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RenderTransformOrigin="0.5,0.5">

            <!--White  background for projector mode-->
            <!--<Rectangle Name="projectorModeRectangle" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="Collapsed"/>-->
            <!--Rectangle displaing video-->
            <Rectangle Name="WebcamVideo" Visibility="Visible"/>
            <!--this one draws red boxes around markers-->
            <Image Name="ViewportOverlay" Visibility="Visible"/>
            <!--hello text-->
            <Canvas x:Name="ARControls" Visibility="Visible">
            </Canvas>
        </Grid>
        </StackPanel>

        <TextBlock Name="HelloText" Visibility="Visible" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" FontStyle="Normal" Foreground="White" TextWrapping="Wrap" Margin="150,0">
            Aplikacja AR Designer jest integralną częścia pracy magisterskiej pt.: <LineBreak/>
            "Projektowanie interfejsów użytkownika w ujęciu rzeczywistości rozszerzonej"<LineBreak/><LineBreak/>
            
            Autor: Arkadiusz Benedykt<LineBreak/><LineBreak/>
            
            Aby rozpocząc pracę z aplikacją.....
        </TextBlock>

        <!--application menu on the left side-->
        <Border x:Name="GlassBorder" CornerRadius="10" Style="{StaticResource GlassBorderStyle}" Height="450" Width="240" MouseEnter="GlassBorder_MouseEnter" MouseLeave="GlassBorder_MouseLeave" VerticalAlignment="Center" HorizontalAlignment="Left">
            <StackPanel Margin="5" Background="#45313131">
                <StackPanel Orientation="Horizontal" Style="{StaticResource StackPanelMargin}">
                    <sdk:Label Content="Resolution : "/>
                    <ComboBox Width="127" HorizontalAlignment="Stretch" x:Name="resolutionCombo" SelectionChanged="videoFormatCombo_SelectionChanged" DropDownClosed="resolutionCombo_DropDownClosed">
                        <ComboBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Path=PixelWidth}" />
                                        <TextBlock> x</TextBlock>
                                        <TextBlock Text="{Binding Path=PixelHeight}" />
                                    </StackPanel>
                                    <!--<TextBlock Text="{Binding Path=FramesPerSecond, Converter={StaticResource Fps2TextConverter}}"  Foreground="DarkRed" FontSize="10"/>-->
                                </StackPanel>
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>

                </StackPanel>
                <StackPanel Orientation="Horizontal" Style="{StaticResource StackPanelMargin}">
                    <sdk:Label Content="Projector mode : "/>
                    <CheckBox Content="Off" Name="projectorMode" Unchecked="projectorMode_Unchecked" Checked="projectorMode_Checked" />
                </StackPanel>
                <StackPanel Orientation="Horizontal" Style="{StaticResource StackPanelMargin}">
                    <sdk:Label Content="Highlight markers : "/>
                    <CheckBox Content="Off" Name="highlighMarkers" />
                </StackPanel>
                <StackPanel Orientation="Horizontal" Style="{StaticResource StackPanelMargin}">
                    <sdk:Label Content="Confidence : "/>
                    <Slider Name="confidence" Minimum="1" Maximum="100" Value="35" Width="129" />
                </StackPanel>
                <StackPanel Orientation="Horizontal" Style="{StaticResource StackPanelMargin}">
                    <sdk:Label Content="Scale : "/>
                    <Slider Name="scale" Minimum="1" Maximum="1000" Value="350" Width="159" />
                </StackPanel>
                <StackPanel Orientation="Horizontal" Style="{StaticResource StackPanelMargin}">
                    <sdk:Label Content="Treshold : "/>
                    <Slider Name="treshold" Width="143" HorizontalAlignment="Stretch"  Minimum="50" Maximum="300" Value="{Binding arDetector.Threshold, Mode=TwoWay}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Style="{StaticResource StackPanelMargin}">
                    <sdk:Label Content="X : "/>
                    <Slider Name="xxx" Width="143" HorizontalAlignment="Stretch"  Minimum="-500" Maximum="2000" Value="0"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal" Style="{StaticResource StackPanelMargin}">
                    <sdk:Label Content="Y : "/>
                    <Slider Name="yyy" Width="143" HorizontalAlignment="Stretch"  Minimum="-500" Maximum="2000" Value="0"/>
                </StackPanel>

                <StackPanel Orientation="Horizontal" Style="{StaticResource StackPanelMargin}">
                    <Border x:Name="loadXMLBorder" Height="50" Width="100" CornerRadius="10" Style="{StaticResource GlassBorderStyle}">
                        <Button Content="Load XML" Click="Button_Click_1" />
                    </Border>
                    <Border x:Name="saveXMLBorder" Height="50" Width="100" CornerRadius="10" Style="{StaticResource GlassBorderStyle}">
                        <Button Content="Save XML" Click="Button_Click" />
                    </Border>
                </StackPanel>
                <Button Content="Start" Height="23" Name="start" Width="75" Click="start_Click" />

                <StackPanel Orientation="Horizontal" Style="{StaticResource StackPanelMargin}">
                    <sdk:Label Content="Run in fullscreen : "/>
                    <CheckBox Content="Off" Name="FullScreen" Checked="FullScreen_Checked" Unchecked="FullScreen_Unchecked"  />
                </StackPanel>
            </StackPanel>
            <Border.RenderTransform>
                <TranslateTransform X="-225" />
            </Border.RenderTransform>
            <Border.Resources>
                <Storyboard x:Name="HoverIn">
                    <DoubleAnimation
                                    Storyboard.TargetName="GlassBorder"
                                    Storyboard.TargetProperty="(Border.RenderTransform).(TranslateTransform.X)"
                                    From="-225"
                                    To="-10"
                                    Duration="0:0:0.2"
                                    RepeatBehavior="1x" />
                    <DoubleAnimation 
                                    Storyboard.TargetName="GlassBorder"
                                    Storyboard.TargetProperty="Opacity"
                                    From="0.2"
                                    To="0.9"
                                    Duration="0:0:0.2"
                                    RepeatBehavior="1x"/>
                </Storyboard>
                <Storyboard x:Name="HoverOut">
                    <DoubleAnimation
                                    Storyboard.TargetName="GlassBorder"
                                    Storyboard.TargetProperty="(Border.RenderTransform).(TranslateTransform.X)"
                                    From="-10"
                                    To="-225"
                                    Duration="0:0:0.2"
                                    RepeatBehavior="1x" />
                    <DoubleAnimation 
                                    Storyboard.TargetName="GlassBorder"
                                    Storyboard.TargetProperty="Opacity"
                                    From="0.9"
                                    To="0.2"
                                    Duration="0:0:0.2"
                                    RepeatBehavior="1x"/>
                </Storyboard>
            </Border.Resources>

        </Border>


    </Grid>
</UserControl>